<template>
  <d2-container>
    <div class="d2-breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>佣金发放管理</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <el-form :inline="true" class="SearchForm" label-width="110px">
       <el-row :gutter="20">
        <el-col :span="7">
      <el-form-item label="佣金单号">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.commissionNo"
          clearable
        ></el-input>
      </el-form-item>
        </el-col> <el-col :span="7">
      <el-form-item label="关联业务单号">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.businessNo"
          clearable
        ></el-input>
      </el-form-item>
      </el-col>
       <el-col :span="7">
      <el-form-item label="入账账号昵称">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.nickName"
          clearable
        ></el-input>
      </el-form-item>
       </el-col>
        <el-col :span="7">
      <el-form-item label="入账账号手机">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.wxPhone"
          clearable
        ></el-input>
      </el-form-item>
        </el-col>
         <el-col :span="7">
      <el-form-item label="入账账号身份">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.roleName"
          clearable
        ></el-input>
      </el-form-item>
         </el-col>
          <el-col :span="7">
      <el-form-item label="入账状态">
        <el-select
          v-model="searchForm.state"
          placeholder="请选择"
          style="width: 207px"
        >
          <el-option label="未入账" :value="0"></el-option>
          <el-option label="已入账" :value="1"></el-option>
        </el-select>
      </el-form-item>
          </el-col>
           <el-col :span="7">
      <el-button type="primary" @click="search()" icon="el-icon-search" style="margin:10px"
        >查询</el-button
      >
      <el-button type="danger" icon="el-icon-refresh" @click="reset" style="margin:10px"
        >重置</el-button
      >
           </el-col>
       </el-row>
    </el-form>

    <el-table border :data="tableData.list">
      <el-table-column
        label="佣金单号"
        align="center"
        prop="commissionNo"
      ></el-table-column>
      <el-table-column
        label="关联业务单号"
        align="center"
        prop="businessNo"
      ></el-table-column>
      <el-table-column
        label="金额"
        align="center"
        prop="money"
      ></el-table-column>
      <el-table-column
        label="入账账号昵称"
        align="center"
        prop="nickName"
      ></el-table-column>
      <el-table-column
        label="入账账号手机"
        align="center"
        prop="wxPhone"
      ></el-table-column>
      <el-table-column
        label="入账账号身份"
        align="center"
        prop="roleName"
      ></el-table-column>
      <el-table-column
        label="入账状态"
        align="center"
        prop="price"
      >
       <template slot-scope="scope">
          {{ ["未入账", "已入账"][scope.row.state] }}
        </template>
      </el-table-column>
      <el-table-column
        label="发放期数"
        align="center"
        prop="stage"
      ></el-table-column>
      <el-table-column
        label="发放时间"
        align="center"
        prop="createTime"
      ></el-table-column>
    </el-table>
    <el-pagination
      @size-change="search"
      @current-change="search"
      :current-page.sync="page"
      :page-sizes="[10, 25, 50, 100]"
      :page-size.sync="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="tableData.total"
    ></el-pagination>
  </d2-container>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      searchForm: {},
      query: {},
      tableData: {
        list: [],
        total: 0,
      },
      page: 1,
      pageSize: 10,
      rules: {},
    };
  },
  methods: {
    search() {
      let params = {
        pageNum: this.page,
        pageSize: this.pageSize,
        ...this.searchForm,
      };

      this.$axios.post("/wxCommissionGrant/list", params).then((result) => {
        if (result) {
          this.tableData = {
            list: result.data.list,
            total: result.data.total,
          };
        } else {
          this.$message.error(result.data.msg);
        }
      });
    },
    reset() {
      this.searchForm = {};
      this.search();
    },
  },
  created() {
    this.search();
  },
};
</script>

<style scoped lang="scss">
</style>
